package com.zc.config;

import com.zc.aspect.WebLogAspect;
import com.zc.property.WebLogProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: cong
 * @create: 2024/7/27
 */
@Configuration
@EnableConfigurationProperties(WebLogProperties.class)
@ConditionalOnProperty(prefix = "weblog", name = "enable", matchIfMissing = true)
public class WebLogConfig {

    @Bean
    @ConditionalOnMissingBean
    public WebLogAspect webLogAspect()
    {
        return new WebLogAspect();
    }
}
